
             
/**
 * Copyright (c) 2012-2013 JLLT Corp. 2012-2013,All Rights Reserved.
 * This software is published under the 金麟龙腾商贸有限公司.
 * License version 1.0, a copy of which has been included with this
 * distribution in the LICENSE.txt file.
 *
 * @File name:  AddTOrderAction.java   添加【订单信息:T_ORDER】
 * @Create on:  2012-10-09 11:34:660
 * @Author   :  陈伟
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 */
           
        
package com.boho.ecp.order.action;

            
import java.sql.Connection;

import cn.boho.framework.actions.ActionImp;
import cn.boho.framework.context.ActionContext;
import cn.boho.framework.service.MessageService;

import com.boho.ecp.cart.service.CartService;
import com.boho.ecp.order.service.OrderService;

public class AddTOrderAction extends ActionImp {
	@Override
	protected void doException(ActionContext atx, Exception ex) {
		atx.setErrorContext("BOHO_COMMON_1001", MessageService.getMessage("BOHO_COMMON_1001"),"【订单信息】", ex);
	}
	@Override
	protected int performExecute(ActionContext atx) throws Exception {
		Connection con = atx.getConection();
		String orderId = OrderService.newOrder(atx, con);
		CartService.clearCart(atx, con);
		atx.setValue("ORDER_ID", orderId);
		return 1;
	}
	@Override
	protected int verifyParameters(ActionContext atx) throws Exception {
		return 1;
	}
}
